package com.example.flowable.local;
import com.example.FlowableLocalDb;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;

/**
 * 流程任务
 *
 * @author wsl
 */
public class TaskFlowable extends FlowableLocalDb {

    @Test
    public void completeTask() {
        String taskId = "7504";//任务编号
        TaskService taskService = processEngine.getTaskService();
        Task task = taskService.createTaskQuery()
                .taskId(taskId)
                .taskAssignee("b")
                .singleResult();
        Map<String, Object> variables = new HashMap<>();//任务参数
        variables.put("approve",false);
        taskService.complete(task.getId(),variables);
    }
}
